<template>
  <a-button v-bind="$attrs">
    <!-- 具名插槽 -->
    <slot name="icon">
      <icon-svg v-if="icon" :icon="icon" :size="iconSize" :color="iconColor" />
    </slot>
    <slot />
  </a-button>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'MyButton',
  props: {
    icon: {
      type: String,
    },
    iconSize: {
      type: Number,
      default: 14,
    },
    iconColor: {
      type: String,
      default: '',
    },
  },
  setup() {
    return {};
  },
});
</script>

<style scoped></style>
